<div class="purchases view">
    <h2 class="left"><?php __('Compra'); ?></h2>
    <div class="actions specific">
        <ul>
            <li><?php echo $this->Html->link(__('Editar', true), array('action' => 'edit', $purchase['Purchase']['id'])); ?> </li>
            <li><?php echo $this->Html->link(__('Eliminar', true), array('action' => 'delete', $purchase['Purchase']['id']), null, sprintf(__('Esta seguro que desea eliminar la compra # %s?', true), date('d/m/Y', strtotime($purchase['Purchase']['purchase_date'])))); ?> </li>
        </ul>
    </div>
    <br />
    <br />
    <br />
    <dl><?php $i = 0;
$class = ' class="altrow"'; ?>
        <dt<?php if ($i % 2 == 0)
            echo $class; ?>><?php __('Id'); ?></dt>
        <dd<?php if ($i++ % 2 == 0)
                echo $class; ?>>
                <?php echo $purchase['Purchase']['id']; ?>
            &nbsp;
        </dd>
        <dt<?php if ($i % 2 == 0)
                    echo $class; ?>><?php __('Fecha de Compra'); ?></dt>
        <dd<?php if ($i++ % 2 == 0)
                echo $class; ?>>
                <?php
                $fecha = date('d/m/Y', strtotime($purchase['Purchase']['purchase_date']));
                echo $fecha;
                ?>
            &nbsp;
        </dd>
        <dt<?php if ($i % 2 == 0)
                    echo $class; ?>><?php __('Cantidad'); ?></dt>
        <dd<?php if ($i++ % 2 == 0)
                echo $class; ?>>
                <?php echo $purchase['Purchase']['purchase_amount']; ?>
            &nbsp;
        </dd>
        <dt<?php if ($i % 2 == 0)
                    echo $class; ?>><?php __('Artículo'); ?></dt>
        <dd<?php if ($i++ % 2 == 0)
                echo $class; ?>>
                <?php echo $this->Html->link($purchase['Article']['mark'] . '-' . $purchase['Article']['model'], array('controller' => 'articles', 'action' => 'view', $purchase['Article']['id'])); ?>
            &nbsp;
        </dd>
        <dt<?php if ($i % 2 == 0)
                    echo $class; ?>><?php __('Proveedor'); ?></dt>
        <dd<?php if ($i++ % 2 == 0)
                echo $class; ?>>
                <?php echo $this->Html->link($purchase['Supplier']['name'], array('controller' => 'articles', 'action' => 'view', $purchase['Supplier']['id'])); ?>
            &nbsp;
        </dd>
        <dt<?php if ($i % 2 == 0)
                    echo $class; ?>><?php __('Pedido'); ?></dt>
        <dd<?php if ($i++ % 2 == 0)
                echo $class; ?>>
                <?php
                if ($purchase['Purchase']['order_id'] != NULL) {
                    $fecha = date('d/m/Y', strtotime($purchase['Order']['date']));
                    echo $this->Html->link($fecha, array('controller' => 'articles', 'action' => 'view', $purchase['Supplier']['id']));
                } else {
                    $fecha = 'Carga Inicial';
                    echo $fecha;
                }
            ?> &nbsp;
        </dd>
    </dl>
</div>
